﻿@model DCMS.ViewModel.Models.Terminals.ChannelModel

@Html.HiddenFor(model => model.Id)
@Html.HiddenFor(model => model.StoreId)
@Html.HiddenFor(model => model.CreateDate)
<div class="form-group">
    <lable class="col-lg-3 control-label">
        名称 <i class="fa fa-exclamation-circle text-warning fa-lg" data-placement="top" data-toggle="tooltip" title="" data-original-title="渠道名称"></i>
    </lable>
    <div class="col-lg-8">
        <input asp-for="Name" class="form-control" />
    </div>
</div>
<div class="form-group">
    <lable class="col-lg-3 control-label">
        预设属性<i class="fa fa-exclamation-circle text-warning fa-lg" data-placement="top" data-toggle="tooltip" title="" data-original-title="预设属性"></i>
    </lable>
    <div class="col-lg-8">
        <dcms-select asp-for="Attribute" asp-items="@Model.Attributes" asp-default="-预设属性-" class="form-control" />
    </div>

</div>
<div class="form-group">
    <lable class="col-lg-3 control-label">
        描述<i class="fa fa-exclamation-circle text-warning fa-lg" data-placement="top" data-toggle="tooltip" title="" data-original-title="片区名称"></i>
    </lable>
    <div class="col-lg-8">
        <input asp-for="Describe" class="form-control" />
    </div>
</div>
<div class="form-group">
    <lable class="col-lg-3 control-label">
        序号<i class="fa fa-exclamation-circle text-warning fa-lg" data-placement="top" data-toggle="tooltip" title="" data-original-title="顺序号"></i>
    </lable>
    <div class="col-lg-8">
        <input asp-for="OrderNo" class="form-control" />
    </div>
    <script>
		$(function () {
            $('input').click(function () {
                $(this).select();
            });
            @*$("#Name").change(function () {
                debugger;
                var attrs = eval("(" + "[@Html.Raw(string.Join(",",Model.Attributes.Select(o => "{Text:'" + o.Text+ "',Value:" + o.Value + "}").ToList()))]" + ")");
                var name = $("#Name").val();
                if (name != null && typeof (name) != undefined) {
                    var attr = attrs.find(attr => attr.Text == name.trim());
                    if (attr != null && typeof (attr) != undefined) {
                        $("#Attribute").val(attr.Value);
                    }
                    else {
                        var last = $("#Attribute").find("option").length;
                        $("#Attribute").find("option")[last - 1].selected=true;
                    }
                }
            });
            $("#Attribute").change(function () {
                if ($(this).val() > 0) {
                    $("#Name").val($(this).find("option:selected").text());
                }
                else {
                    $("#Name").val("");
                }
            });*@
		});
    </script>
</div>